//------------------------------------------------------------------------------
// <copyright company="Telligent Systems">
//     Copyright (c) Telligent Systems Corporation.  All rights reserved.
// </copyright> 
//------------------------------------------------------------------------------

using System;
using CommunityServer.Components;

namespace CommunityServer.Blogs.Components
{

    /// <summary>
    /// Utility class which can be used when running CS.Blogs
    /// in single blog mode this class can be used to route all requests
    /// to a predefined blog
    /// </summary>
    public class SingleBlogLocation : Location
    {
        public SingleBlogLocation(string path, string physicalPath, bool exclude):base(path,physicalPath,exclude)
        {
            
        }

        public override string ReWriteUrl(string path, string queryString)
        {
            string app = Globals.ApplicationPath;
            path = string.Format("{0}/{1}{2}", app, WeblogConfiguration.Instance().DefautApplicationKey, path.Substring(app.Length));
            return base.ReWriteUrl (path, queryString);
        }

    }
}
